<%
## Tangent, an online sign-up sheet
## Copyright (C) 2008 Justin Ludwig and Adam Stuenkel
## 
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
-%>

<% @page_title = "Edit #{@activity.name} for #{@event.name}" %>
<h1>Edit <%=h @activity.name %> for <%=h @event.name %></h1>

<%= error_messages_for :activity %>

<% fields_for(@event, :builder => ApplicationFormBuilder) do |f| %>

<fieldset>
  <legend>Event Info</legend>
<%= f.property_line :text, :name %>
<%= f.property_line :text, :tag_list, :label => "Tags" %>
<%= property_line_tag link_to_array(@event.coordinators), 'coordinators' %>
<%= f.property_line :datetime, :start_date, :label => "Start" %>
<%= f.property_line :datetime, :end_date, :label => "End" %>
</fieldset>

<% end %>

<% form_for([@event, @activity], :builder => ApplicationFormBuilder) do |f| %>

<fieldset>
  <legend>Activity Info</legend>
<%= f.property_line :text_field, :name, :required => true %>
<%= f.property_line :text_field, :tag_list, :label => "Tags", :description => "separate with commas" %>
<%= f.property_line :text_field, :criteria, :description => "attributes required of participants; separate with commas" %>
<%= f.property_line :text_field, :openings, :class => 'number', :description => 'maximum number of participants; leave blank for unlimited participants' %>
<%= f.property_line :datetime_input, :start_date, :label => "Start", :description => "if different than event; free-form date like \"tomorrow\" or \"tues 1pm\" or \"2/28/09\"" %>
<%= f.property_line :datetime_input, :end_date, :label => "End", :description => "if different than event; free-form date like \"tomorrow\" or \"tues 1pm\" or \"2/28/09\"" %>
<%= f.property_line :html_editor, :details, :class => "long", :rows => 10, :label => "Full-Page Details" %>
</fieldset>

<div class="buttons">
    <%= f.styled_submit "Update", :style => "width:6em;" %>
    <%= styled_button_to_back "Cancel", :style => "width:6em;" %>
</div>

<% end %>

